<template>
  <a-result status="404" title="404" sub-title="对不起，您暂无访问权限！">
    <template #extra>
      <a-button type="primary" @click="back">返回</a-button>
    </template>
  </a-result>
</template>
<script setup lang="ts">
import { useRoute, useRouter } from 'vue-router'

const router = useRouter()
console.log('router', router)
const route = useRoute()
console.log('route', route)
const back = () => {
  if ((router.options.history.state.position as number) > 1) {
    router.go(-1)
  } else {
    router.replace({
      name: 'login'
    })
  }
}
</script>

<style lang="scss" scoped></style>
